package com.xinpu.service.impl;

import com.xinpu.dto.UserDto;
import com.xinpu.mapper.UserMapper;
import com.xinpu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * UserServiceImpl
 *
 * @author ayuan
 * @date 2021/4/16
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    /**
     * 用户详细信息
     *
     * @param id
     * @return
     */
    @Override
    public UserDto findById(Integer id) {
        return userMapper.findById(id);
    }

    @Override
    public int addUserCount(Integer pid) {
        return userMapper.addUserCount(pid);
    }

    /**
     * 线索或用户统计
     *
     * @param type
     * @param userOrClue
     * @param pid
     * @return
     */
    @Override
    public int userOrClueCount(Integer userOrClue, Integer type, Integer pid) {
        return userMapper.userOrClueCount(userOrClue, type, pid);
    }

    /**
     * 完成用户统计
     *
     * @param type
     * @param pid
     * @return
     */
    @Override
    public int okUser(Integer type, Integer pid) {
        return userMapper.okUser(type, pid);
    }

    /**
     * 用户总数
     *
     * @return
     */
    @Override
    public Integer userCount() {
        return userMapper.userCount();
    }

    /**
     * 线索总数
     *
     * @return
     */
    @Override
    public Integer clueCount() {
        return userMapper.clueCount();
    }

    /**
     * 公海用户总数
     *
     * @return
     */
    @Override
    public Integer publicUserCount() {
        return userMapper.publicUserCount();
    }

    /**
     * 公海线索总数
     *
     * @return
     */
    @Override
    public Integer publicClueCount() {
        return userMapper.publicClueCount();
    }

    /**
     * 用户总数
     *
     * @return
     */
    @Override
    public Integer userNum() {
        return userMapper.userNum();
    }

    /**
     * 男性总数
     *
     * @return
     */
    @Override
    public Integer manNum() {
        return userMapper.manNum();
    }

    /**
     * 女性总数
     *
     * @return
     */
    @Override
    public Integer womanNum() {
        return userMapper.womanNum();
    }
}
